<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
    
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@ include file="../common/commonCssJs.jsp"%>
</head>
<body>

<div id="wapper">
	<header>
	<%@ include file="../common/layout/header.jsp"%>
	</header>
	
	<nav>
	<%@ include file="../common/layout/nav.jsp"%>
	</nav>
	
	<aside>
	<%@ include file="../common/layout/aside.jsp"%>
	</aside>
	
	<section>
		<form action="updateBoard" method="POST" enctype="multipart/form-data">
		<input type="hidden" id="num" name="num" value="${board.num}" />
		<input type="hidden" id="pageNo" name="pageNo" value="${param.pageNo}" />
			<table>
				<tr>
					<th>제목</th>
					<td><input type="text" id="title" name="title" title="제목" value="${board.title}" /></td>
				</tr>
				<tr>
					<th>내용</th>
					<td>
						<textarea rows="20" cols="80" id="content" name="content">${fn:replace(board.content, '\\r\\n', '<br>')}</textarea>
					</td>
				</tr>
				<tr>
					<th>첨부파일</th>
					<td><input type="file" id="file1" name="file1" title="첨부파일1" /></td>
				</tr>		
				<tr>
					<td><input type="button" id="update" value="저장" /></td><td><input type="button" id="cancel" value="취소" /></td>
				</tr>
			</table>
		</form>
	</section>
	
	<footer>
	<%@ include file="../common/layout/footer.jsp"%>
	</footer>
</div>

<script type="text/javascript">
	$("#update").click(function() {
		$("form").submit();
	});
	
	$("#cancel").click(function() {
		$("form").attr("action", "boardView").submit();
	});			
</script>
</body>
</html>